﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DBModel;

namespace CV_Projekt
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var user = Session["User"] as User;

            RedirectUsers(user);
        }

        private void RedirectUsers(User user)
        {
            if (user != null)
            {
                if (user is Applicant)
                {
                    Response.Redirect("WorkSearch.aspx");
                }
                else if (user is HeadHunter)
                {
                    Response.Redirect("HeadHunter.aspx");
                }
                else if (user is SuperAdmin)
                {
                    Response.Redirect("SuperAdmin.aspx");
                }
                else if (user is Publisher)
                {
                    Response.Redirect("Publisher.aspx");
                }


            }
        }
    }
}